package net.oschina.bilbodai.common.beanutil.util;

import java.util.Collection;

/**
 * @author daimao  Date: 16/4/22 Time: 下午3:32
 * @version $Id$
 */
public class CollectionUtils {

    public static boolean isEmpty(Collection collection) {
        return collection == null || collection.size() == 0;
    }

    public static boolean isEmpty(Object[] array) {
        return array == null || array.length == 0;
    }

    public static boolean contains(Object[] array, Object target) {
        for (Object obj : array) {
            if (obj.equals(target)) {
                return true;
            }
        }
        return false;
    }
}